<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>   
    <link rel="stylesheet" href="//at.alicdn.com/t/font_1274766_ki3ygzlv29.css">
    <style>
        *{
            margin:0;
            padding:0;
            list-style: none;
        }
        [v-cloak]{
            display:none;
        }
        .star{
            font-size:30px;
            color:gold;
        }
    </style>
</head>
<body>
   <div id="app" v-cloak>
       <h2>{{template}}--{{score}}</h2>
       <i class="star iconfont" v-for="item in count"  :class="item<=template?'icon-star':'icon-star1'"
       @mouseenter="template=item"
       @click="score=item"
       @mouseleave="template=score"
       >

       </i>

   </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el:"#app",
            data(){
                return{
                    template:5,
                    count: 10,
                    score:5

                }
            },
            methods:{

            },
            mounted(){

            },
            computed:{

            },
            //某个变量改变后触发某些动作
            watch:{

            }
        })
    </script>
</body>
</html>